package routers

import (
	"shudao-chat-go/controllers"

	beego "github.com/beego/beego/v2/server/web"
)

func init() {
	// 前端页面路由 - 放在API路由之前
	beego.Router("/", &controllers.FrontendController{}, "get:Index")
	// beego.Router("/index", &controllers.FrontendController{}, "get:Index")

	ns := beego.NewNamespace("apiv1",
		//推荐问题
		beego.NSRouter("/recommend_question", &controllers.TotalController{}, "get:GetRecommendQuestion"),
		//提交意见反馈
		beego.NSRouter("/submit_feedback", &controllers.TotalController{}, "post:SubmitFeedback"),
		//返回政策文件
		beego.NSRouter("/get_policy_file", &controllers.TotalController{}, "get:GetPolicyFile"),
		//发送deepseek消息
		beego.NSRouter("/send_deepseek_message", &controllers.ChatController{}, "post:SendDeepSeekMessage"),

		// OSS上传相关路由
		beego.NSRouter("/oss/upload", &controllers.OssController{}, "post:Upload"),
		// 新的OSS接口路由
		beego.NSRouter("/oss/shudao/upload_image", &controllers.ShudaoOssController{}, "post:UploadImage"),
		// 上传JSON文件接口
		beego.NSRouter("/oss/shudao/upload_json", &controllers.ShudaoOssController{}, "post:UploadPPTJson"),

		//返回四条功能卡片
		beego.NSRouter("/get_function_card", &controllers.TotalController{}, "get:GetFunctionCard"),
		//返回三条热点问题
		beego.NSRouter("/get_hot_question", &controllers.TotalController{}, "get:GetHotQuestion"),
		//获取历史记录GetHistoryRecord()
		beego.NSRouter("/get_history_record", &controllers.ChatController{}, "get:GetHistoryRecord"),
		//修改考试题目
		beego.NSRouter("/re_modify_question", &controllers.ExamController{}, "post:ReModifyQuestion"),
		//重新生产单题
		beego.NSRouter("/re_produce_single_question", &controllers.ChatController{}, "post:ReProduceSingleQuestion"),
		//隐患识别
		beego.NSRouter("/hazard", &controllers.HazardController{}, "post:Hazard"),
		// 点赞和踩
		beego.NSRouter("/like_and_dislike", &controllers.TotalController{}, "post:LikeAndDislike"),
		// 隐患识别获取历史记录
		beego.NSRouter("/get_history_recognition_record", &controllers.SceneController{}, "get:GetHistoryRecognitionRecord"),
		// 获取识别记录详情
		beego.NSRouter("/get_recognition_record_detail", &controllers.SceneController{}, "get:GetRecognitionRecordDetail"),
		//用户在输入框中每输入一个字，就调用一次阿里大模型返回推荐问题
		beego.NSRouter("/get_user_recommend_question", &controllers.ChatController{}, "get:GetUserRecommendQuestion"),
		// 用户传文件名取数据库寻找链接
		beego.NSRouter("/get_file_link", &controllers.ChatController{}, "get:GetFileLink"),
		// 删除对话
		beego.NSRouter("/delete_conversation", &controllers.ChatController{}, "post:DeleteConversation"),
		//删除历史记录
		beego.NSRouter("/delete_history_record", &controllers.ChatController{}, "post:DeleteHistoryRecord"),
		// 删除隐患识别的历史记录
		beego.NSRouter("/delete_recognition_record", &controllers.ChatController{}, "post:DeleteRecognitionRecord"),
		// 保存步骤
		beego.NSRouter("/save_step", &controllers.HazardController{}, "post:SaveStep"),
		// 获取隐患识别三级场景标题查询正确和错误的示例图
		beego.NSRouter("/get_third_scene_example_image", &controllers.SceneController{}, "get:GetThirdSceneExampleImage"),
		// 保存ppt大纲
		beego.NSRouter("/save_ppt_outline", &controllers.ChatController{}, "post:SavePPTOutline"),
		// 文件下载接口
		beego.NSRouter("/download_file", &controllers.TotalController{}, "get:GetPdfOssDownloadLink"),
	)
	beego.AddNamespace(ns)
}
